#include "DestroyerConfiguration.h"

DestroyerConfiguration::DestroyerConfiguration(int _numberConfiguration)
: numberConfiguration(_numberConfiguration){ }

DestroyerConfiguration::~DestroyerConfiguration() { }

DestroyerConfiguration* DestroyerConfiguration::createDestroyerConfiguration(int _type) throw (InvalidBoatConfiguration) {
	switch (_type) {
	case 1:
		return new DestroyerConfiguration1();
		break;
	case 2:
		return new DestroyerConfiguration2();
		break;
	default:
		throw InvalidBoatConfiguration(2);
	}
}

int DestroyerConfiguration::getNumberConfiguration() const {
	return numberConfiguration;
}

DestroyerConfiguration1::DestroyerConfiguration1() : DestroyerConfiguration(1){ }

DestroyerConfiguration1::~DestroyerConfiguration1() { }

RectangularBoatShape* DestroyerConfiguration1::getShape(const string& _name, const Point<int>& _origin, char _filledChar) const {
	return new RectangularBoatShape(_name, _origin, Dimension<int>(2,1), _filledChar);
}

DestroyerConfiguration2::DestroyerConfiguration2() : DestroyerConfiguration(2) { }

DestroyerConfiguration2::~DestroyerConfiguration2() { }

RectangularBoatShape* DestroyerConfiguration2::getShape(const string& _name, const Point<int>& _origin, char _filledChar) const {
	return new RectangularBoatShape(_name, _origin, Dimension<int>(1,2), _filledChar);
}
